﻿using System;
using System.Collections.Generic;
using System.Text;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x0200093A RID: 2362
	internal class XGuildTerritoryDocument : XDocComponent
	{
		// Token: 0x17002C08 RID: 11272
		// (get) Token: 0x06008EB1 RID: 36529 RVA: 0x0013C7D0 File Offset: 0x0013A9D0
		public override uint ID
		{
			get
			{
				return XGuildTerritoryDocument.uuID;
			}
		}

		// Token: 0x06008EB2 RID: 36530 RVA: 0x0013C7E8 File Offset: 0x0013A9E8
		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
			bool flag = DlgBase<GuildTerritoryReportDlg, GuildTerritoryBahaviour>.singleton.IsVisible();
			if (flag)
			{
				this.SendGCFCommonReq(GCFReqType.GCF_FIGHT_REPORT);
			}
		}

		// Token: 0x06008EB3 RID: 36531 RVA: 0x0013C810 File Offset: 0x0013AA10
		public static void Execute(OnLoadedCallback callback = null)
		{
			XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryBattleDesignation", XGuildTerritoryDocument.mGuildDestination, false);
			XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryBattleTransfer", XGuildTerritoryDocument.mGuildTransfer, false);
			XGuildTerritoryDocument.AsyncLoader.AddTask("Table/territorybattle", XGuildTerritoryDocument.mGuildTerritoryList, false);
			XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryRewd", XGuildTerritoryDocument.mTerritoryRewd, false);
			XGuildTerritoryDocument.AsyncLoader.Execute(callback);
		}

		// Token: 0x06008EB4 RID: 36532 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		public static void OnLoadcallback()
		{
		}

		// Token: 0x06008EB5 RID: 36533 RVA: 0x0013C884 File Offset: 0x0013AA84
		public override void OnEnterScene()
		{
			base.OnEnterScene();
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HALL;
			if (flag)
			{
				GuildMiniReportHandler.msgs.Clear();
			}
			bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT;
			if (flag2)
			{
				XSingleton<GuildPassMgr>.singleton.InitBoard();
			}
			bool flag3 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT;
			if (flag3)
			{
				for (int i = 0; i < this.fxJvDians.Length; i++)
				{
					bool flag4 = i % 3 == 0;
					if (flag4)
					{
						this.fxJvDians[i] = XSingleton<XFxMgr>.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_grey", null, true);
					}
					else
					{
						bool flag5 = i % 3 == 1;
						if (flag5)
						{
							this.fxJvDians[i] = XSingleton<XFxMgr>.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_red", null, true);
						}
						else
						{
							this.fxJvDians[i] = XSingleton<XFxMgr>.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_blue", null, true);
						}
					}
					bool flag6 = i / 3 == 0;
					if (flag6)
					{
						List<float> floatList = XSingleton<XGlobalConfig>.singleton.GetFloatList("GuildTerritoryUpPos");
						Vector3 vector = new Vector3(floatList[0], floatList[1], floatList[2]);
						float num = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleUpRadius")) * float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleClientRadiusK"));
						this.fxJvDians[i].Play(vector, Quaternion.identity, new Vector3(num, 1f, num), 1f);
						this.fxJvPos[0] = vector;
					}
					else
					{
						bool flag7 = i / 3 == 1;
						if (flag7)
						{
							List<float> floatList2 = XSingleton<XGlobalConfig>.singleton.GetFloatList("GuildTerritoryMidPos");
							Vector3 vector2 = new Vector3(floatList2[0], floatList2[1], floatList2[2]);
							float num2 = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleMidRadius")) * float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleClientRadiusK"));
							this.fxJvDians[i].Play(vector2, Quaternion.identity, new Vector3(num2, 1f, num2), 1f);
							this.fxJvPos[1] = vector2;
						}
						else
						{
							List<float> floatList3 = XSingleton<XGlobalConfig>.singleton.GetFloatList("GuildTerritoryBtmPos");
							Vector3 vector3 = new Vector3(floatList3[0], floatList3[1], floatList3[2]);
							float num3 = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleBtmRadius")) * float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("TerritoryBattleClientRadiusK"));
							this.fxJvDians[i].Play(vector3, Quaternion.identity, new Vector3(num3, 1f, num3), 1f);
							this.fxJvPos[2] = vector3;
						}
					}
				}
			}
		}

		// Token: 0x06008EB6 RID: 36534 RVA: 0x0013CB5C File Offset: 0x0013AD5C
		public override void OnEnterSceneFinally()
		{
			base.OnEnterSceneFinally();
			this.CheckJvDianState();
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT;
			if (flag)
			{
				bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded() && DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible();
				if (flag2)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.SetVisible(false);
				}
			}
			bool flag3 = Process_RpcC2G_DoEnterScene.runstate > 0U;
			if (flag3)
			{
				bool flag4 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT;
				if (flag4)
				{
					XLevelRewardDocument specificDocument = XDocuments.GetSpecificDocument<XLevelRewardDocument>(XLevelRewardDocument.uuID);
					bool flag5 = specificDocument != null;
					if (flag5)
					{
						bool flag6 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
						if (flag6)
						{
							DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.ResetPressState();
							DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetVisiblePure(false);
							DlgBase<RadioBattleDlg, RadioBattleBahaviour>.singleton.Show(false);
							DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.SetFakeHide(true);
						}
						specificDocument.ShowLevelReward();
					}
				}
			}
		}

		// Token: 0x06008EB7 RID: 36535 RVA: 0x0013CC5C File Offset: 0x0013AE5C
		public override void OnLeaveScene()
		{
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT;
			if (flag)
			{
				XSingleton<GuildPassMgr>.singleton.ClearAll();
				bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded() && DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible();
				if (flag2)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.SetVisible(true);
				}
			}
			bool flag3 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT;
			if (flag3)
			{
				for (int i = 0; i < this.fxJvDians.Length; i++)
				{
					bool flag4 = this.fxJvDians[i] != null;
					if (flag4)
					{
						XSingleton<XFxMgr>.singleton.DestroyFx(this.fxJvDians[i], true);
					}
					this.fxJvDians[i] = null;
				}
				XBattleDocument.DelMiniMapFx(this.maptoken[0]);
				XBattleDocument.DelMiniMapFx(this.maptoken[1]);
				XBattleDocument.DelMiniMapFx(this.maptoken[2]);
			}
			base.OnLeaveScene();
		}

		// Token: 0x06008EB8 RID: 36536 RVA: 0x0013CD49 File Offset: 0x0013AF49
		public override void OnDetachFromHost()
		{
			this.jvdians.Clear();
			this.roles.Clear();
			this.guilds.Clear();
			this.rwds.Clear();
			base.OnDetachFromHost();
		}

		// Token: 0x06008EB9 RID: 36537 RVA: 0x0013CD84 File Offset: 0x0013AF84
		public override void PostUpdate(float fDeltaT)
		{
			base.PostUpdate(fDeltaT);
			bool flag = Time.frameCount % 60 == 0;
			if (flag)
			{
				bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT;
				if (flag2)
				{
					this.SendGCFReadysInfo();
					this.SendGFCFightInfo();
				}
				else
				{
					bool flag3 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT;
					if (flag3)
					{
						this.SendGFCFightInfo();
					}
				}
			}
			bool flag4 = Time.time > this.lastShowInfoTime + 10f;
			if (flag4)
			{
				bool flag5 = this.qInfo.Count != 0;
				if (flag5)
				{
					this.qInfo.Clear();
				}
				bool flag6 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible() && DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler != null;
				if (flag6)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler.ShowBuffs();
				}
			}
		}

		// Token: 0x06008EBA RID: 36538 RVA: 0x0013CE5C File Offset: 0x0013B05C
		public FightDesignation.RowData GetDesignation(uint hit)
		{
			FightDesignation.RowData[] table = XGuildTerritoryDocument.mGuildDestination.Table;
			for (int i = table.Length - 1; i >= 0; i--)
			{
				bool flag = table[i].ID <= hit;
				if (flag)
				{
					return table[i];
				}
			}
			return null;
		}

		// Token: 0x06008EBB RID: 36539 RVA: 0x0013CEB0 File Offset: 0x0013B0B0
		public void ActiveJvDian(GCFJvDianType type, int index)
		{
			bool flag = type == GCFJvDianType.GCF_JUDIAN_UP;
			if (flag)
			{
				bool flag2 = this.fxJvDians[0] != null && this.fxJvDians[1] != null && this.fxJvDians[2] != null;
				if (flag2)
				{
					this.fxJvDians[0].SetActive(index == 0);
					this.fxJvDians[1].SetActive(index == 1);
					this.fxJvDians[2].SetActive(index == 2);
				}
			}
			else
			{
				bool flag3 = type == GCFJvDianType.GCF_JUDIAN_MID;
				if (flag3)
				{
					bool flag4 = this.fxJvDians[3] != null && this.fxJvDians[4] != null && this.fxJvDians[5] != null;
					if (flag4)
					{
						this.fxJvDians[3].SetActive(index == 0);
						this.fxJvDians[4].SetActive(index == 1);
						this.fxJvDians[5].SetActive(index == 2);
					}
				}
				else
				{
					bool flag5 = this.fxJvDians[6] != null && this.fxJvDians[7] != null && this.fxJvDians[8] != null;
					if (flag5)
					{
						this.fxJvDians[6].SetActive(index == 0);
						this.fxJvDians[7].SetActive(index == 1);
						this.fxJvDians[8].SetActive(index == 2);
					}
				}
			}
		}

		// Token: 0x06008EBC RID: 36540 RVA: 0x0013CFF7 File Offset: 0x0013B1F7
		public void SendGCFEnterin(int index)
		{
			this.mapid = XGuildTerritoryDocument.mGuildTransfer.GetByid((uint)index).sceneid;
			this.SendGCFCommonReq(GCFReqType.GCF_JOIN_FIGHT_SCENE);
		}

		// Token: 0x06008EBD RID: 36541 RVA: 0x0013D018 File Offset: 0x0013B218
		public void SendWaitScene(uint tid)
		{
			this.territoryid = tid;
			this.SendGCFCommonReq(GCFReqType.GCF_JOIN_READY_SCENE);
		}

		// Token: 0x06008EBE RID: 36542 RVA: 0x0013D02C File Offset: 0x0013B22C
		public void SendGCFCommonReq(GCFReqType type)
		{
			RpcC2M_GCFCommonReq rpcC2M_GCFCommonReq = new RpcC2M_GCFCommonReq();
			rpcC2M_GCFCommonReq.oArg.mapid = this.mapid;
			rpcC2M_GCFCommonReq.oArg.reqtype = type;
			rpcC2M_GCFCommonReq.oArg.territoryid = this.territoryid;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GCFCommonReq);
		}

		// Token: 0x06008EBF RID: 36543 RVA: 0x0013D080 File Offset: 0x0013B280
		public void RespGCFCommon(GCFReqType type, GCFCommonRes res)
		{
			this.jvdians = res.jvdians;
			this.guilds.Clear();
			for (int i = 0; i < res.guilds.Count; i++)
			{
				GCFGuild gcfguild = new GCFGuild();
				gcfguild.brief = res.guilds[i];
				gcfguild.groupScore = this.GetGroupPoint(res.guilds, gcfguild.brief.group);
				this.guilds.Add(gcfguild);
			}
			this.roles = res.roles;
			this.rwds = res.rewards;
			this.fields = res.fields;
			this.mmyinfo = res.myinfo;
			bool flag = this.mmyinfo != null;
			if (flag)
			{
				this.feats = this.mmyinfo.feats;
			}
			this.territoryid = res.territoryid;
			this.winguild = res.winguild;
			bool flag2 = type == GCFReqType.GCF_FIGHT_REPORT;
			if (flag2)
			{
				bool flag3 = DlgBase<GuildTerritoryReportDlg, GuildTerritoryBahaviour>.singleton.IsVisible();
				if (flag3)
				{
					DlgBase<GuildTerritoryReportDlg, GuildTerritoryBahaviour>.singleton.RefreshAll();
				}
			}
			else
			{
				bool flag4 = type == GCFReqType.GCF_JOIN_READY_SCENE;
				if (!flag4)
				{
					bool flag5 = type == GCFReqType.GCF_FIGHT_RESULT;
					if (flag5)
					{
						LevelRewardTerritoryHandler territoryHandler = DlgBase<XLevelRewardView, XLevelRewardBehaviour>.singleton.GetTerritoryHandler();
						bool flag6 = territoryHandler != null;
						if (flag6)
						{
							territoryHandler.RefreshAll();
						}
						else
						{
							XSingleton<XDebug>.singleton.AddErrorLog("level reward is nil", null, null, null, null, null);
						}
					}
					else
					{
						bool flag7 = type == GCFReqType.GCF_JOIN_FIGHT_SCENE;
						if (flag7)
						{
						}
					}
				}
			}
		}

		// Token: 0x06008EC0 RID: 36544 RVA: 0x0013D1F4 File Offset: 0x0013B3F4
		public void SendGCFReadysInfo()
		{
			RpcC2M_GCFReadysInfoReq rpc = new RpcC2M_GCFReadysInfoReq();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EC1 RID: 36545 RVA: 0x0013D214 File Offset: 0x0013B414
		public void RespGCFReadysInfo(GCFReadyInfoRes ores)
		{
			this.ready_lefttime = ores.lefttime;
			bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible() && !XSingleton<GuildPassMgr>.singleton.isOpen && this.ready_lefttime > 0U;
			if (flag)
			{
				DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime(this.ready_lefttime, -1);
			}
			XSingleton<GuildPassMgr>.singleton.UpdateInfo(ores.allinfo);
		}

		// Token: 0x06008EC2 RID: 36546 RVA: 0x0013D27C File Offset: 0x0013B47C
		public void SendGFCFightInfo()
		{
			RpcC2M_GCFFightInfoReqC2M rpc = new RpcC2M_GCFFightInfoReqC2M();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EC3 RID: 36547 RVA: 0x0013D29C File Offset: 0x0013B49C
		public void RespGCFFightInfo(GCFFightInfoRes res)
		{
			this.fight_lefttime = res.lefttime;
			bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible() && XSingleton<GuildPassMgr>.singleton.isOpen && this.fight_lefttime > 0U;
			if (flag)
			{
				DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime(this.fight_lefttime, -1);
			}
			XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
			this.guilds.Clear();
			for (int i = 0; i < res.guilds.Count; i++)
			{
				GCFGuild gcfguild = new GCFGuild();
				gcfguild.brief = res.guilds[i];
				gcfguild.groupScore = this.GetGroupPoint(res.guilds, gcfguild.brief.group);
				gcfguild.isPartern = (res.guilds[i].group == res.mygroup);
				bool flag2 = gcfguild.brief.guildid == specificDocument.UID;
				if (flag2)
				{
					this.myPostion = gcfguild.isPartern;
				}
				this.guilds.Add(gcfguild);
			}
			this.jvdians = res.JvDians;
			this.guilds.Sort(new Comparison<GCFGuild>(this.SortGuildsInfo));
			GuildBattleMiniRankHandler miniRankHandler = DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniRankHandler;
			bool flag3 = miniRankHandler != null;
			if (flag3)
			{
				miniRankHandler.RefreshAll();
			}
			this.CheckJvDianState();
			GuildMiniReportHandler miniReportHandler = DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler;
			bool flag4 = miniReportHandler != null;
			if (flag4)
			{
				miniReportHandler.RefreshMyInfo(res.myinfo);
			}
		}

		// Token: 0x06008EC4 RID: 36548 RVA: 0x0013D428 File Offset: 0x0013B628
		private uint GetGroupPoint(List<GCFGuildBrief> guilds, int group)
		{
			uint num = 0U;
			for (int i = 0; i < guilds.Count; i++)
			{
				bool flag = guilds[i].group == group;
				if (flag)
				{
					num += guilds[i].point;
				}
			}
			return num;
		}

		// Token: 0x06008EC5 RID: 36549 RVA: 0x0013D47C File Offset: 0x0013B67C
		private int SortGuildsInfo(GCFGuild x, GCFGuild y)
		{
			bool flag = x.groupScore != y.groupScore;
			int result;
			if (flag)
			{
				result = (int)(y.groupScore - x.groupScore);
			}
			else
			{
				result = (int)(y.brief.point - x.brief.point);
			}
			return result;
		}

		// Token: 0x06008EC6 RID: 36550 RVA: 0x0013D4CC File Offset: 0x0013B6CC
		public void OnFeatsChange(uint feat)
		{
			this.feats = feat;
		}

		// Token: 0x06008EC7 RID: 36551 RVA: 0x0013D4D8 File Offset: 0x0013B6D8
		public void OnZhanLingNotify(GCFZhanLingPara data)
		{
			GCFZhanLingType zltype = data.zltype;
			XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(data.roleID);
			bool flag = entity == null || entity.Attributes == null;
			if (!flag)
			{
				XTerritoryComponent xterritoryComponent = entity.GetXComponent(XTerritoryComponent.uuID) as XTerritoryComponent;
				bool flag2 = zltype == GCFZhanLingType.GCFZL_BEGIN;
				if (flag2)
				{
					xterritoryComponent.ToStart();
				}
				else
				{
					bool flag3 = zltype == GCFZhanLingType.GCFZL_BREAK;
					if (flag3)
					{
						xterritoryComponent.Interupt();
					}
					else
					{
						bool flag4 = zltype == GCFZhanLingType.GCFZL_END;
						if (flag4)
						{
							xterritoryComponent.Success();
						}
					}
				}
			}
		}

		// Token: 0x06008EC8 RID: 36552 RVA: 0x0013D564 File Offset: 0x0013B764
		public void ModifyMinimapState(GCFJvDianType type1, int index2)
		{
			int num = XFastEnumIntEqualityComparer<GCFJvDianType>.ToInt(type1);
			Vector3 pos = this.fxJvPos[num - 1];
			string fx = this.fxs[index2];
			bool flag = type1 == GCFJvDianType.GCF_JUDIAN_UP;
			if (flag)
			{
				XBattleDocument.DelMiniMapFx(this.maptoken[0]);
				this.maptoken[0] = XBattleDocument.AddMiniMapFx(pos, fx);
			}
			else
			{
				bool flag2 = type1 == GCFJvDianType.GCF_JUDIAN_MID;
				if (flag2)
				{
					XBattleDocument.DelMiniMapFx(this.maptoken[1]);
					this.maptoken[1] = XBattleDocument.AddMiniMapFx(pos, fx);
				}
				else
				{
					XBattleDocument.DelMiniMapFx(this.maptoken[2]);
					this.maptoken[2] = XBattleDocument.AddMiniMapFx(pos, fx);
				}
			}
		}

		// Token: 0x06008EC9 RID: 36553 RVA: 0x0013D604 File Offset: 0x0013B804
		public void OnGCFSynG2CNtf(GCFG2CSynPara data)
		{
			GuildMiniReportHandler miniReportHandler = DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler;
			bool flag = miniReportHandler != null;
			if (flag)
			{
				miniReportHandler.Push(data.type, data);
			}
			bool flag2 = data.type == GCFG2CSynType.GCF_G2C_SYN_KILL_COUNT;
			if (flag2)
			{
				XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(data.roleid);
				bool flag3 = entity != null;
				if (flag3)
				{
					bool flag4 = entity.BillBoard != null;
					if (flag4)
					{
						entity.BillBoard.OnFightDesignationInfoChange(data.killcount);
					}
				}
			}
		}

		// Token: 0x06008ECA RID: 36554 RVA: 0x0013D684 File Offset: 0x0013B884
		public void ReceiveBattleSkill(PvpBattleKill battleSkillInfo)
		{
			bool flag = XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_CASTLE_FIGHT;
			if (!flag)
			{
				GVGBattleSkill gvgbattleSkill = new GVGBattleSkill();
				gvgbattleSkill.killerID = battleSkillInfo.killID;
				gvgbattleSkill.deadID = battleSkillInfo.deadID;
				gvgbattleSkill.contiKillCount = battleSkillInfo.contiKillCount;
				XEntity entityConsiderDeath = XSingleton<XEntityMgr>.singleton.GetEntityConsiderDeath(gvgbattleSkill.killerID);
				XEntity entityConsiderDeath2 = XSingleton<XEntityMgr>.singleton.GetEntityConsiderDeath(gvgbattleSkill.deadID);
				bool flag2 = entityConsiderDeath == null || entityConsiderDeath2 == null;
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("entity id: " + gvgbattleSkill.killerID, " dead id: " + gvgbattleSkill.deadID, null, null, null, null);
				}
				else
				{
					gvgbattleSkill.killerName = entityConsiderDeath.Name;
					gvgbattleSkill.deadName = entityConsiderDeath2.Name;
					bool flag3 = XSingleton<XEntityMgr>.singleton.IsAlly(entityConsiderDeath);
					gvgbattleSkill.killerPosition = (this.myPostion ? flag3 : (!flag3));
					DlgBase<BattleContiDlg, BattleContiBehaviour>.singleton.AddBattleSkill(gvgbattleSkill);
					XSingleton<XDebug>.singleton.AddGreenLog(string.Format("ReceiveBattleSkill:{0} --- ,{1} ,.... {2}", gvgbattleSkill.killerName, gvgbattleSkill.deadName, gvgbattleSkill.contiKillCount), null, null, null, null, null);
				}
			}
		}

		// Token: 0x06008ECB RID: 36555 RVA: 0x0013D7C0 File Offset: 0x0013B9C0
		private void CheckJvDianState()
		{
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT;
			if (flag)
			{
				for (int i = 0; i < this.jvdians.Count; i++)
				{
					bool flag2 = string.IsNullOrEmpty(this.jvdians[i].guildname);
					if (flag2)
					{
						this.ActiveJvDian(this.jvdians[i].type, 0);
						this.ModifyMinimapState(this.jvdians[i].type, 0);
					}
					else
					{
						this.ActiveJvDian(this.jvdians[i].type, this.IsPartener(this.jvdians[i].guildname) ? 2 : 1);
						this.ModifyMinimapState(this.jvdians[i].type, this.IsPartener(this.jvdians[i].guildname) ? 1 : 2);
					}
				}
			}
		}

		// Token: 0x06008ECC RID: 36556 RVA: 0x0013D8C4 File Offset: 0x0013BAC4
		private bool IsPartener(string guildname)
		{
			for (int i = 0; i < this.guilds.Count; i++)
			{
				bool flag = this.guilds[i].brief.guildname == guildname;
				if (flag)
				{
					return this.guilds[i].isPartern;
				}
			}
			return false;
		}

		// Token: 0x06008ECD RID: 36557 RVA: 0x0013D928 File Offset: 0x0013BB28
		public void OnAddBuff(ulong roleID, uint doodadID)
		{
			BuffTable.RowData buffData = XSingleton<XBuffTemplateManager>.singleton.GetBuffData((int)doodadID, 1);
			string text = string.Empty;
			bool flag = buffData == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog(string.Format("GuildTerritory: Buff data not found: [{0} {1}]", doodadID, 1), null, null, null, null, null);
			}
			else
			{
				text = buffData.BuffName;
			}
			XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(roleID);
			bool flag2 = entity == null;
			if (flag2)
			{
				XSingleton<XDebug>.singleton.AddWarningLog("entity is null", null, null, null, null, null);
			}
			else
			{
				string name = entity.Name;
				StringBuilder stringBuilder = new StringBuilder();
				bool flag3 = false;
				for (int i = 0; i < text.Length; i++)
				{
					bool flag4 = text[i] == '[';
					if (flag4)
					{
						flag3 = true;
					}
					bool flag5 = text[i] == ')';
					if (flag5)
					{
						flag3 = false;
					}
					bool flag6 = flag3;
					if (flag6)
					{
						stringBuilder.Append(text[i]);
					}
					bool flag7 = text[i] == '(';
					if (flag7)
					{
						flag3 = true;
					}
					bool flag8 = text[i] == ']';
					if (flag8)
					{
						flag3 = false;
					}
				}
				this.AddBuffInfo(name, stringBuilder.ToString());
			}
		}

		// Token: 0x06008ECE RID: 36558 RVA: 0x0013DA60 File Offset: 0x0013BC60
		private void AddBuffInfo(string left, string right)
		{
			this.lastShowInfoTime = Time.time;
			XBattleCaptainPVPDocument.KillInfo item = default(XBattleCaptainPVPDocument.KillInfo);
			item.KillName = left;
			item.DeadName = right;
			this.qInfo.Enqueue(item);
			bool flag = (long)this.qInfo.Count > (long)((ulong)XGuildTerritoryDocument.GAME_INFO);
			if (flag)
			{
				this.qInfo.Dequeue();
			}
			bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible() && DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler != null;
			if (flag2)
			{
				DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_miniReportHandler.ShowBuffs();
			}
		}

		// Token: 0x17002C09 RID: 11273
		// (get) Token: 0x06008ED0 RID: 36560 RVA: 0x0013DB14 File Offset: 0x0013BD14
		// (set) Token: 0x06008ECF RID: 36559 RVA: 0x0013DAF6 File Offset: 0x0013BCF6
		public uint bHavaTerritoryRecCount
		{
			get
			{
				return this.mHaveTerritoryCount;
			}
			set
			{
				this.mHaveTerritoryCount = value;
				DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryAllianceInterface, true);
			}
		}

		// Token: 0x17002C0A RID: 11274
		// (get) Token: 0x06008ED2 RID: 36562 RVA: 0x0013DB50 File Offset: 0x0013BD50
		// (set) Token: 0x06008ED1 RID: 36561 RVA: 0x0013DB2C File Offset: 0x0013BD2C
		public XGuildTerritoryDocument.GuildTerritoryStyle TerritoryStyle
		{
			get
			{
				return this.mCurTerritoryStyle;
			}
			set
			{
				this.mCurTerritoryStyle = value;
				DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryIconInterface, true);
				this.RefreshGuildTerritoryInfo();
			}
		}

		// Token: 0x17002C0B RID: 11275
		// (get) Token: 0x06008ED4 RID: 36564 RVA: 0x0013DB84 File Offset: 0x0013BD84
		// (set) Token: 0x06008ED3 RID: 36563 RVA: 0x0013DB68 File Offset: 0x0013BD68
		public bool bHavaShowMessageIcon
		{
			get
			{
				return this.mShowMessageIcon;
			}
			set
			{
				this.mShowMessageIcon = value;
				DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryMessageInterface, true);
			}
		}

		// Token: 0x06008ED5 RID: 36565 RVA: 0x0013DB9C File Offset: 0x0013BD9C
		public void OnClickTerritoryIcon()
		{
			XGuildTerritoryDocument.GuildTerritoryStyle territoryStyle = this.TerritoryStyle;
			if (territoryStyle != XGuildTerritoryDocument.GuildTerritoryStyle.INFORM)
			{
				if (territoryStyle == XGuildTerritoryDocument.GuildTerritoryStyle.ACTIVITY)
				{
					DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.SetVisibleWithAnimation(true, null);
				}
			}
			else
			{
				this.TerritoryStyle = XGuildTerritoryDocument.GuildTerritoryStyle.NONE;
				XSingleton<UiUtility>.singleton.ShowModalDialog(XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING"), XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING_GO"), XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING_ENSURE"), new ButtonClickEventHandler(this.OnInformClick));
			}
		}

		// Token: 0x06008ED6 RID: 36566 RVA: 0x0013DC0C File Offset: 0x0013BE0C
		private bool OnInformClick(IXUIButton btn)
		{
			XSingleton<UiUtility>.singleton.CloseModalDlg();
			DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.SetVisibleWithAnimation(true, null);
			return false;
		}

		// Token: 0x17002C0C RID: 11276
		// (get) Token: 0x06008ED7 RID: 36567 RVA: 0x0013DC38 File Offset: 0x0013BE38
		public List<GuildTerrChallInfo> GuildTerrChallList
		{
			get
			{
				return this.mGuildTerrChall;
			}
		}

		// Token: 0x17002C0D RID: 11277
		// (get) Token: 0x06008ED8 RID: 36568 RVA: 0x0013DC50 File Offset: 0x0013BE50
		public List<CityData> CityDataList
		{
			get
			{
				return this.mCityDataList;
			}
		}

		// Token: 0x17002C0E RID: 11278
		// (get) Token: 0x06008ED9 RID: 36569 RVA: 0x0013DC68 File Offset: 0x0013BE68
		public List<GuildTerritoryAllianceInfo> GuildTerrAllianceInfos
		{
			get
			{
				return this.mGuildTerritoryAllianceList;
			}
		}

		// Token: 0x06008EDA RID: 36570 RVA: 0x0013DC80 File Offset: 0x0013BE80
		public bool TryTerritoryAlliance(uint terriroryID, out int messageID)
		{
			bool result = false;
			messageID = 0;
			bool flag = terriroryID == this.SelfGuildTerritoryID;
			if (flag)
			{
				messageID = 4;
			}
			else
			{
				uint targetTerrioryType = this.GetTargetTerrioryType(terriroryID);
				uint targetTerrioryType2 = this.GetTargetTerrioryType(this.SelfGuildTerritoryID);
				bool flag2 = targetTerrioryType == 0U;
				if (flag2)
				{
					messageID = 0;
				}
				int num = (int)(targetTerrioryType - targetTerrioryType2);
				bool flag3 = num > 1;
				if (flag3)
				{
					bool flag4 = targetTerrioryType == 3U;
					if (flag4)
					{
						messageID = 2;
					}
					else
					{
						bool flag5 = targetTerrioryType == 2U;
						if (flag5)
						{
							messageID = 1;
						}
					}
				}
				else
				{
					bool flag6 = num < 1;
					if (flag6)
					{
						bool flag7 = targetTerrioryType2 == 3U;
						if (flag7)
						{
							messageID = 5;
						}
						else
						{
							messageID = 3;
						}
					}
					else
					{
						result = true;
					}
				}
			}
			return result;
		}

		// Token: 0x06008EDB RID: 36571 RVA: 0x0013DD2C File Offset: 0x0013BF2C
		public uint GetTargetTerrioryType(uint cityID)
		{
			uint result = 0U;
			bool flag = cityID > 0U;
			if (flag)
			{
				TerritoryBattle.RowData byID = XGuildTerritoryDocument.mGuildTerritoryList.GetByID(cityID);
				bool flag2 = byID != null;
				if (flag2)
				{
					result = byID.territorylevel;
				}
			}
			return result;
		}

		// Token: 0x06008EDC RID: 36572 RVA: 0x0013DD68 File Offset: 0x0013BF68
		public bool TryGetCityData(uint cityID, out CityData data)
		{
			return this.mCityDataDic.TryGetValue(cityID, out data);
		}

		// Token: 0x06008EDD RID: 36573 RVA: 0x0013DD88 File Offset: 0x0013BF88
		public void SendGuildTerritoryCityInfo()
		{
			RpcC2M_ReqGuildTerrCityInfo rpc = new RpcC2M_ReqGuildTerrCityInfo();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EDE RID: 36574 RVA: 0x0013DDA8 File Offset: 0x0013BFA8
		public void ReceiveGuildTerritoryCityInfo(ReqGuildTerrCityInfo res)
		{
			XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
			this.CurrentType = res.type;
			this.SelfTargetTerritoryID = res.targetid;
			this.SelfGuildTerritoryID = 0U;
			this.SelfAllianceID = res.allianceId;
			this.mCityDataList.Clear();
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGuildTerritoryCityInfo:", this.CurrentType.ToString(), res.targetid.ToString(), res.cityinfo.Count.ToString(), null, null);
			int i = 0;
			int count = res.cityinfo.Count;
			while (i < count)
			{
				bool flag = this.mCityDataDic.ContainsKey(res.cityinfo[i].id);
				if (flag)
				{
					this.mCityDataDic[res.cityinfo[i].id] = res.cityinfo[i];
				}
				else
				{
					this.mCityDataDic.Add(res.cityinfo[i].id, res.cityinfo[i]);
				}
				bool flag2 = res.cityinfo[i].guildid > 0UL;
				if (flag2)
				{
					this.mCityDataList.Add(res.cityinfo[i]);
				}
				bool flag3 = specificDocument.BasicData.uid == res.cityinfo[i].guildid;
				if (flag3)
				{
					this.SelfGuildTerritoryID = res.cityinfo[i].id;
				}
				i++;
			}
			this.mCityDataList.Sort(new Comparison<CityData>(this.CompareCityData));
			bool flag4 = DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.IsVisible();
			if (flag4)
			{
				DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.RefreshData();
			}
		}

		// Token: 0x06008EDF RID: 36575 RVA: 0x0013DF7D File Offset: 0x0013C17D
		public void SetGuildTerritoryCityInfo(uint cityID, ulong guildID)
		{
			this.RefreshGuildTerritoryInfo();
		}

		// Token: 0x06008EE0 RID: 36576 RVA: 0x0013DF88 File Offset: 0x0013C188
		private int CompareCityData(CityData city1, CityData city2)
		{
			return (int)(city2.id - city1.id);
		}

		// Token: 0x06008EE1 RID: 36577 RVA: 0x0013DFA8 File Offset: 0x0013C1A8
		public void RefreshGuildTerritoryInfo()
		{
			bool flag = DlgBase<GuildTerritoryMainDlg, GuildTerritoryMainBehaviour>.singleton.IsVisible();
			if (flag)
			{
				this.SendGuildTerritoryCityInfo();
			}
			bool flag2 = DlgBase<GuildTerritoryDeclareDlg, GuildTerritoryDeclareBehaviour>.singleton.IsVisible();
			if (flag2)
			{
				this.SendGuildTerritoryChallInfo(this.CurrentTerritoryID);
			}
		}

		// Token: 0x06008EE2 RID: 36578 RVA: 0x0013DFE8 File Offset: 0x0013C1E8
		public void SendGuildTerritoryChallInfo(uint uid)
		{
			bool flag = uid == 0U;
			if (!flag)
			{
				RpcC2M_ReqGuildTerrChallInfo rpcC2M_ReqGuildTerrChallInfo = new RpcC2M_ReqGuildTerrChallInfo();
				rpcC2M_ReqGuildTerrChallInfo.oArg.id = uid;
				this.CurrentTerritoryID = uid;
				XSingleton<XClientNetwork>.singleton.Send(rpcC2M_ReqGuildTerrChallInfo);
			}
		}

		// Token: 0x06008EE3 RID: 36579 RVA: 0x0013E028 File Offset: 0x0013C228
		public void ReceiveGuildTerritoryChallInfo(ReqGuildTerrChallInfoArg arg, ReqGuildTerrChallInfoRes res)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGuildTerritoryChallInfo:", res.challinfo.Count.ToString(), null, null, null, null);
			this.mGuildTerrChall.Clear();
			this.mGuildTerrChall.AddRange(res.challinfo);
			this.mGuildTerritoryAllianceList.Clear();
			this.EnterBattleTime = res.cdtime;
			Dictionary<ulong, GuildTerritoryAllianceInfo> dictionary = new Dictionary<ulong, GuildTerritoryAllianceInfo>();
			int i = 0;
			int count = res.challinfo.Count;
			while (i < count)
			{
				bool flag = dictionary.ContainsKey(res.challinfo[i].allianceid);
				if (flag)
				{
					dictionary[res.challinfo[i].allianceid].Add(res.challinfo[i]);
				}
				else
				{
					bool flag2 = !dictionary.ContainsKey(res.challinfo[i].guildid);
					if (flag2)
					{
						GuildTerritoryAllianceInfo guildTerritoryAllianceInfo = new GuildTerritoryAllianceInfo();
						guildTerritoryAllianceInfo.Set(res.challinfo[i]);
						dictionary.Add(res.challinfo[i].guildid, guildTerritoryAllianceInfo);
					}
				}
				i++;
			}
			this.mGuildTerritoryAllianceList.AddRange(dictionary.Values);
			bool flag3 = this.CurrentTerritoryID > 0U;
			if (flag3)
			{
				bool flag4 = DlgBase<GuildTerritoryDeclareDlg, GuildTerritoryDeclareBehaviour>.singleton.IsVisible();
				if (flag4)
				{
					DlgBase<GuildTerritoryDeclareDlg, GuildTerritoryDeclareBehaviour>.singleton.RefreshWhenShow();
				}
				else
				{
					DlgBase<GuildTerritoryDeclareDlg, GuildTerritoryDeclareBehaviour>.singleton.SetVisibleWithAnimation(true, null);
				}
			}
		}

		// Token: 0x06008EE4 RID: 36580 RVA: 0x0013E1AC File Offset: 0x0013C3AC
		public void SendReceiveTerritroyInfo()
		{
			RpcC2M_ReqGuildTerrIntellInfo rpc = new RpcC2M_ReqGuildTerrIntellInfo();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EE5 RID: 36581 RVA: 0x0013E1CC File Offset: 0x0013C3CC
		public void ReceiveTerritoryInterllInfo(ReqGuildTerrIntellInfoRes oRes)
		{
			bool flag = DlgBase<GuildTerritoryMessageDlg, GuildTerritoryMessageBehaviour>.singleton.IsVisible();
			if (flag)
			{
				DlgBase<GuildTerritoryMessageDlg, GuildTerritoryMessageBehaviour>.singleton.SetNewInfo(oRes.intellInfo);
			}
		}

		// Token: 0x06008EE6 RID: 36582 RVA: 0x0013E1FC File Offset: 0x0013C3FC
		public bool TryGetTerritoryGuildName(ulong guildid, out string guildName)
		{
			guildName = string.Empty;
			int i = 0;
			int count = this.mGuildTerrChall.Count;
			while (i < count)
			{
				bool flag = this.mGuildTerrChall[i].guildid == guildid;
				if (flag)
				{
					guildName = this.mGuildTerrChall[i].guildname;
					return true;
				}
				i++;
			}
			return false;
		}

		// Token: 0x06008EE7 RID: 36583 RVA: 0x0013E268 File Offset: 0x0013C468
		public void SendGuildTerrAllianceInfo()
		{
			RpcC2M_ReqGuildTerrAllianceInfo rpc = new RpcC2M_ReqGuildTerrAllianceInfo();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EE8 RID: 36584 RVA: 0x0013E288 File Offset: 0x0013C488
		public void ReceiveGuildTerrAllianceInfo(ReqGuildTerrAllianceInfoRes res)
		{
			this.Allianceid = res.allianceid;
			this.guildAllianceInfos = res.allianceinfo;
			DlgBase<GuildTerritoryLeagueDlg, GuildTerritoryLeagueBehaviour>.singleton.RefreshData();
		}

		// Token: 0x06008EE9 RID: 36585 RVA: 0x0013E2B0 File Offset: 0x0013C4B0
		public void SendAllianceGuildTerr(uint territoryID)
		{
			XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
			bool flag = specificDocument.Position == GuildPosition.GPOS_LEADER || specificDocument.Position == GuildPosition.GPOS_VICELEADER;
			if (flag)
			{
				RpcC2M_AllianceGuildTerr rpcC2M_AllianceGuildTerr = new RpcC2M_AllianceGuildTerr();
				rpcC2M_AllianceGuildTerr.oArg.id = territoryID;
				XSingleton<XClientNetwork>.singleton.Send(rpcC2M_AllianceGuildTerr);
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_TB_DECLEAR_NO_PERMISSON"), "fece00");
			}
		}

		// Token: 0x06008EEA RID: 36586 RVA: 0x0013E320 File Offset: 0x0013C520
		public void ReceiveAllianceGuildTerr(AllianceGuildTerrArg arg, AllianceGuildTerrRes res)
		{
			bool flag = res.errorcod > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(res.errorcod, "fece00");
				bool flag2 = res.errorcod == ErrorCode.ERR_DECLAREWAR_OUT_TIME;
				if (flag2)
				{
					this.RefreshGuildTerritoryInfo();
				}
			}
			else
			{
				this.RefreshGuildTerritoryInfo();
			}
		}

		// Token: 0x06008EEB RID: 36587 RVA: 0x0013E378 File Offset: 0x0013C578
		public void SendTryAlliance(ulong guildID)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendTryAlliance", guildID.ToString(), null, null, null, null);
			RpcC2M_TryAlliance rpcC2M_TryAlliance = new RpcC2M_TryAlliance();
			rpcC2M_TryAlliance.oArg.guild = guildID;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_TryAlliance);
		}

		// Token: 0x06008EEC RID: 36588 RVA: 0x0013E3C0 File Offset: 0x0013C5C0
		public void ReceiveTryAlliance(TryAllianceArg arg, TryAlliance res)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveTryAlliance", null, null, null, null, null);
			bool flag = res.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(res.errorcode, "fece00");
			}
			else
			{
				this.SendGuildTerritoryChallInfo(this.CurrentTerritoryID);
			}
		}

		// Token: 0x06008EED RID: 36589 RVA: 0x0013E418 File Offset: 0x0013C618
		public void SendRecAlliance(ulong guildID)
		{
			RpcC2M_RecAlliance rpcC2M_RecAlliance = new RpcC2M_RecAlliance();
			rpcC2M_RecAlliance.oArg.guildid = guildID;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_RecAlliance);
		}

		// Token: 0x06008EEE RID: 36590 RVA: 0x0013E448 File Offset: 0x0013C648
		public void ReceiveRecAlliance(RecAllianceArg arg, RecAllianceRes res)
		{
			bool flag = res.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(res.errorcode, "fece00");
			}
			else
			{
				this.bHavaTerritoryRecCount = 0U;
				DlgBase<GuildTerritoryLeagueDlg, GuildTerritoryLeagueBehaviour>.singleton.SetVisibleWithAnimation(false, null);
			}
		}

		// Token: 0x06008EEF RID: 36591 RVA: 0x0013E494 File Offset: 0x0013C694
		public void SendClearGuildTerrAlliance()
		{
			RpcC2M_ClearGuildTerrAlliance rpc = new RpcC2M_ClearGuildTerrAlliance();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008EF0 RID: 36592 RVA: 0x0013E4B4 File Offset: 0x0013C6B4
		public void ReceiveClearGuildTerrAlliance(ClearGuildTerrAllianceRes res)
		{
			bool flag = res.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(res.errorcode, "fece00");
			}
			else
			{
				this.bHavaTerritoryRecCount = 0U;
				DlgBase<GuildTerritoryLeagueDlg, GuildTerritoryLeagueBehaviour>.singleton.SetVisibleWithAnimation(false, null);
			}
		}

		// Token: 0x04002E98 RID: 11928
		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("XGuildTerritoryDocument");

		// Token: 0x04002E99 RID: 11929
		public static readonly uint GAME_INFO = 1U;

		// Token: 0x04002E9A RID: 11930
		public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();

		// Token: 0x04002E9B RID: 11931
		private static FightDesignation mGuildDestination = new FightDesignation();

		// Token: 0x04002E9C RID: 11932
		public static GuildTransfer mGuildTransfer = new GuildTransfer();

		// Token: 0x04002E9D RID: 11933
		public static TerritoryBattle mGuildTerritoryList = new TerritoryBattle();

		// Token: 0x04002E9E RID: 11934
		public static TerritoryRewd mTerritoryRewd = new TerritoryRewd();

		// Token: 0x04002E9F RID: 11935
		public XFx[] fxJvDians = new XFx[9];

		// Token: 0x04002EA0 RID: 11936
		public Vector3[] fxJvPos = new Vector3[3];

		// Token: 0x04002EA1 RID: 11937
		private float lastShowInfoTime;

		// Token: 0x04002EA2 RID: 11938
		public Queue<XBattleCaptainPVPDocument.KillInfo> qInfo = new Queue<XBattleCaptainPVPDocument.KillInfo>();

		// Token: 0x04002EA3 RID: 11939
		public uint mapid = 0U;

		// Token: 0x04002EA4 RID: 11940
		public List<GCFJvDianInfo> jvdians = new List<GCFJvDianInfo>();

		// Token: 0x04002EA5 RID: 11941
		public List<GCFGuild> guilds = new List<GCFGuild>();

		// Token: 0x04002EA6 RID: 11942
		public List<GCFRoleBrief> roles = new List<GCFRoleBrief>();

		// Token: 0x04002EA7 RID: 11943
		public List<GCFBattleField> fields = new List<GCFBattleField>();

		// Token: 0x04002EA8 RID: 11944
		public List<ItemBrief> rwds = new List<ItemBrief>();

		// Token: 0x04002EA9 RID: 11945
		public GCFRoleBrief mmyinfo = new GCFRoleBrief();

		// Token: 0x04002EAA RID: 11946
		public uint feats = 0U;

		// Token: 0x04002EAB RID: 11947
		public GCFGuildBrief winguild;

		// Token: 0x04002EAC RID: 11948
		public uint ready_lefttime = 0U;

		// Token: 0x04002EAD RID: 11949
		public uint fight_lefttime = 0U;

		// Token: 0x04002EAE RID: 11950
		public uint territoryid = 0U;

		// Token: 0x04002EAF RID: 11951
		public bool myPostion = true;

		// Token: 0x04002EB0 RID: 11952
		private uint[] maptoken = new uint[3];

		// Token: 0x04002EB1 RID: 11953
		private string[] fxs = new string[]
		{
			"Effects/FX_Particle/UIfx/UI_xdtts_white",
			"Effects/FX_Particle/UIfx/UI_xdtts_bule",
			"Effects/FX_Particle/UIfx/UI_xdtts_red"
		};

		// Token: 0x04002EB2 RID: 11954
		private Dictionary<uint, CityData> mCityDataDic = new Dictionary<uint, CityData>();

		// Token: 0x04002EB3 RID: 11955
		private List<CityData> mCityDataList = new List<CityData>();

		// Token: 0x04002EB4 RID: 11956
		private List<GuildTerrChallInfo> mGuildTerrChall = new List<GuildTerrChallInfo>();

		// Token: 0x04002EB5 RID: 11957
		private List<GuildTerritoryAllianceInfo> mGuildTerritoryAllianceList = new List<GuildTerritoryAllianceInfo>();

		// Token: 0x04002EB6 RID: 11958
		private uint mHaveTerritoryCount = 0U;

		// Token: 0x04002EB7 RID: 11959
		private XGuildTerritoryDocument.GuildTerritoryStyle mCurTerritoryStyle = XGuildTerritoryDocument.GuildTerritoryStyle.NONE;

		// Token: 0x04002EB8 RID: 11960
		public ulong Allianceid = 0UL;

		// Token: 0x04002EB9 RID: 11961
		public GUILDTERRTYPE CurrentType = GUILDTERRTYPE.TERR_NOT_OPEN;

		// Token: 0x04002EBA RID: 11962
		public uint SelfGuildTerritoryID = 0U;

		// Token: 0x04002EBB RID: 11963
		public uint SelfTargetTerritoryID = 0U;

		// Token: 0x04002EBC RID: 11964
		public List<GuildTerrAllianceInfo> guildAllianceInfos;

		// Token: 0x04002EBD RID: 11965
		public bool mShowMessage = true;

		// Token: 0x04002EBE RID: 11966
		public bool mShowMessageIcon = false;

		// Token: 0x04002EBF RID: 11967
		public ulong SelfAllianceID = 0UL;

		// Token: 0x04002EC0 RID: 11968
		public uint CurrentTerritoryID = 0U;

		// Token: 0x04002EC1 RID: 11969
		public uint EnterBattleTime = 0U;

		// Token: 0x02001961 RID: 6497
		public enum GuildTerritoryStyle
		{
			// Token: 0x04007DFB RID: 32251
			NONE,
			// Token: 0x04007DFC RID: 32252
			INFORM,
			// Token: 0x04007DFD RID: 32253
			ACTIVITY
		}
	}
}
